<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>06-函数参数默认值</title>
  </head>

  <body>
    <script>
      function getSum(x = 0, y = 0) {
        document.write(x + y)
      }
      getSum(1, 2) //  结果是 3
      getSum() // 结果是0 ，而不是 NaN，因为形参给了默认值,且为0
    </script>
  </body>
</html>
